package com.yonyou.cms.epc.client.entity.graphic;

import com.baomidou.mybatisplus.annotation.*;
import com.yonyou.cms.epc.client.entity.BasePO;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.sysmanage.client.domains.dto.UserDictDto;

import java.io.Serializable;

/**
 * <p>
 * </p>
 * @author xh
 * @since 2022-07-20
 */
@TableName("tt_graphic_info_emp")
public class GraphicInfoEmp extends BasePO<GraphicInfoEmp> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "GRAPHIC_ID", type = IdType.AUTO)
    private Integer graphicId;

    /**
     * APPID
     */
    @TableField(value = "APP_ID")
    private String appId;

    /**
     * 系统代码
     */
    @TableField("SYSTEM_CODE")
    private String systemCode;

    /**
     * 系统名称
     */
    @TableField("SYSTEM_NAME")
    private String systemName;

    /**
     * 车型代码
     */
    @TableField("MODEL_CODE")
    private String modelCode;

    /**
     * 车型名称
     */
    @TableField("MODEL_NAME")
    private String modelName;

    /**
     * 完成状态(默认0未完成，1已完成)
     */
    @TableField("OKSTATE")
    private Integer okstate;

    /**
     * 备注
     */
    @TableField("REMARK")
    private String remark;

    /**
     * 是否删除
     */
    @TableField("IS_DELETED")
    @Version
    @TableLogic
    private Boolean isDeleted;

    /**
     * 更新人信息
     */
    @TableField(exist = false)
    private UserDictDto updateUserInfo;

    /**
     * 创建人信息
     */
    @TableField(exist = false)
    private UserDictDto createUserInfo;

    /**
     * 错误
     */
    @TableField("ERROR")
    private String error;

    public GraphicInfoEmp() {
        super();
    }


    public Integer getGraphicId() {
        return graphicId;
    }

    public void setGraphicId(Integer graphicId) {
        this.graphicId = graphicId;
    }

    public String getSystemCode() {
        return systemCode;
    }

    public void setSystemCode(String systemCode) {
        this.systemCode = systemCode;
    }

    public String getSystemName() {
        return systemName;
    }

    public void setSystemName(String systemName) {
        this.systemName = systemName;
    }

    public String getModelCode() {
        return modelCode;
    }

    public void setModelCode(String modelCode) {
        this.modelCode = modelCode;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public Integer getOkstate() {
        return okstate;
    }

    public void setOkstate(Integer okstate) {
        this.okstate = okstate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public UserDictDto getUpdateUserInfo() {
        return updateUserInfo;
    }

    public void setUpdateUserInfo(UserDictDto updateUserInfo) {
        this.updateUserInfo = updateUserInfo;
    }

    public UserDictDto getCreateUserInfo() {
        return createUserInfo;
    }

    public void setCreateUserInfo(UserDictDto createUserInfo) {
        this.createUserInfo = createUserInfo;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    //    @Override
//    public boolean equals(Object o) {
//        if (this == o) {
//            return true;
//        }
//        if (o == null || getClass() != o.getClass()){
//            return false;
//        }
//        GraphicInfoPO person = (GraphicInfoPO) o;
//        return Objects.equals(systemCode, person.systemCode) &&
//                Objects.equals(systemName,person.systemName) &&
//                Objects.equals(modelCode,person.modelCode) &&
//                Objects.equals(modelName,person.modelName);
//
//    }


    @Override
    protected Serializable pkVal() {
        return this.graphicId;
    }

    @Override
    public String toString() {
        return "GraphicInfoPO{" +
                "graphicId=" + graphicId +
                ", systemCode=" + systemCode +
                ", systemName=" + systemName +
                ", modelCode=" + modelCode +
                ", modelName=" + modelName +
                ", okstate=" + okstate +
                ", remark=" + remark +
                ", isDeleted=" + isDeleted +
                "}";
    }


    /**
     * 将PO 信息转化为DTO
     * @param dto 需要进行转换的dto
     * @author xh
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "graphicId");
    }


}
